1. Field of Invention
This invention generally relates to processing compressed digital images. More particularly, this invention relates to methods and apparatus which combine rotation with decompression of compressed images for devices with asymmetric resolution. The rotation and scaling are built into the decompressing process to avoid spending time and effort in scaling and rotating the decompressed image.
2. Description of Related Art
Data compression is required in data handling processes, where too much data is present for practical applications using the data. Commonly, compression is used in communication links to reduce the transmission time or required bandwidth. Similarly, compression is preferred in image storage systems, including digital printers and copiers, where "pages" of a document to be printed are stored temporarily in precollation memory. The amount of media space on which the image data is stored can be substantially reduced with compression. Generally speaking, scanned images, i.e., electronic representations of hard copy documents, are often large, and thus make desirable candidates for compression.
The image compression standard disseminated by the Joint Photographic Experts Group (JPEG) committee is a compression technique which reduces data redundancies based on pixel-to-pixel correlations. Generally, an image does not change very much on a pixel-to-pixel basis and therefore has what is known as "natural spatial correlation." In natural scenes, correlation is generalized, but not exact. Noise makes each pixel somewhat different from its neighbors.
Many output devices provide an output image having different spatial resolutions in pixels per inch (ppi) along the horizontal and vertical orientation. One example of such a device can be a printer employing 400 ppi.times.600 ppi resolution, i.e., the printer prints 400 ppi in the vertical direction and 600 ppi along the horizontal direction. One typical problem encountered when processing images directed for those devices arises when it is necessary to change the orientation of the image. In such an instance, in order to maintain the same aspect ratio while changing the image's orientation, the amount of image pixels in each direction has to be changed accordingly to cope with the change in resolution. For example, a rotation by 90.degree. or an image transposition will change the orientation of the image. Examples of applications are those that require the image to be changed from "portrait" mode to "landscape" mode for printing, either to adjust the paper output requirements or by any aesthetic motivation.
FIG. 1 shows an example of an image being printed on a 400 ppi.times.600 ppi printer occupying a square region of 1 in..times.1 in. If the image is simply rotated, maintaining the number of pixels, it would occupy a region of 2/3 in..times.3/2 in. and be distorted. Thus, a spatial scaling operation is necessary to "stretch" the image in one direction and to "shrink" the image in the other direction to maintain the image's aspect ratio. Alternatively, FIG. 2 shows a sequence to obtain the same output by pre-scaling the image before rotation.